D:\git\skunkworks\herald-for-cpp\herald-tests\base64string-tests.cpp
Line | Count | Source |
1 | | // Copyright 2020-2021 Herald Project Contributors |
2 | | // SPDX-License-Identifier: Apache-2.0 |
3 | | // |
4 | | |
5 | | #include "catch.hpp" |
6 | | |
7 | | #include "herald/herald.h" |
8 | | |
9 | 1 | TEST_CASE("datatypes-base64string-expected", "[datatypes][base64string][expected]") { |
10 | 1 | SECTION("datatypes-base64string-expected") { |
11 | 1 | std::string hex("6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"); |
12 | 1 | herald::datatype::Data d = herald::datatype::Data::fromHexEncodedString(hex); |
13 | 1 | |
14 | 1 | std::string base64 = herald::datatype::Base64String::encode(d).encoded(); |
15 | 1 | std::string expected("bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0="); |
16 | 1 | |
17 | 1 | REQUIRE(expected == base64); |
18 | 1 | } |
19 | 1 | } |